package com.lapian.designmode.flyweight.test.test_f;


import java.util.HashMap;

/**
 * 创建日期：2022/5/24 0024 15:39
 *
 * @author tony.sun
 * 类说明：
 */
public class Factory {
    private HashMap<String, ConcreteRoleF> pool=new HashMap<>();
    public Father getRoleCategory(String type) {
        if (!pool.containsKey(type)) {
            pool.put(type,new ConcreteRoleF(type));
        }
        return (Father) pool.get(type);
    }

    public void list() {
        System.out.println(pool.size());
    }
}
